<?php


namespace App\Http\Controllers\Admin\Sign;
use App\Http\Controllers\Admin\BaseAdminController;
use App\Models\Rules;
use Illuminate\Support\Facades\DB;

class SignRuleController extends BaseAdminController
{
    public function __construct()
    {
        parent::__construct();
    }
    public function save()
    {
        $content = request('content');
        $signRule =Rules::findOrNew(request('id'));
        $signRule->content = $content;
        $signRule->score =  request('score');
        $signRule-> is_sign =request('is_sign');
        if(!request('is_sign')){
            $signRule-> unsign_day =0;
        }else{
            $signRule-> unsign_day =request('unsign_day');
        }

        $signRule->save();
        return $this->success(route('admin.sign.signs'));
    }
}